package com.example.a79273.shandianban.model;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2016/8/30.
 */
public class YouHuoProducBean {

    /**
     * error_code : 0
     * error_msg : 获取产品详情成功
     * total : 1
     * data : {"mallDetails":{"name":"简约休闲长版薄外套","pic":"/Upload/Product/214001664286/37e1408925.jpg","proid":"214001664286","price":"126.0000","costhtml":"","cprice":"126.0000","transprort_id":"5","vender_id":"","category_id":"","wara_id":"白银","spu_id":"均码","detail":"<html><body style='margin:0'><img src='http://sandban.com//Upload/Product/214001664286/37e140884b.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408842.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408857.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408812.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408845.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e14088b4.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408897.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408898.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408885.jpg' hidefocus='true' style='width:100%' /><\/body><\/html>","content":"<html><head><meta name='viewport' content='width = 320, maximum-scale=1.3, user-scalable=no'><style type='text/css'>table{width:100%;}td{height: 24px; font-size:14px; border-bottom:1px solid #f5f5f5;}div{color:#636161;font-size:18px;padding:20px 0px;}<\/style><\/head><body style='padding:10px;'><div>产品属性<\/div><table><tr><td>人群<\/td><td>女士<\/td><tr><tr><td>季节<\/td><td>春<\/td><tr><tr><td>风格<\/td><td>简约<\/td><tr><tr><td>流行元素<\/td><td>纯色<\/td><tr><tr><td>毛衫款型<\/td><td>开胸衫<\/td><tr><tr><td>版型<\/td><td>直筒型<\/td><tr><tr><td>袖型<\/td><td>长袖<\/td><tr><tr><td>领型<\/td><td>V领<\/td><tr><tr><td>衣门襟<\/td><td>其它<\/td><tr><tr><td>成份<\/td><td>棉<\/td><tr><tr><td>含毛量<\/td><td>-<\/td><tr><tr><td>针数<\/td><td>12针<\/td><tr><\/table><div>尺码表（单位：CM）<\/div><table><thead><tr><td>尺码<\/td><td>衣长<\/td><td>肩宽<\/td><td>胸围<\/td><td>袖长<\/td><\/tr><\/thead><tbody><tr><td>均码<\/td><td>84<\/td><td>39<\/td><td>50<\/td><td>55<\/td><\/tr><\/tbody><\/table><\/body><\/html>","sharelink":"http://sandban.com/Mall/235000040127","sharepic":"/Upload/Product/214001664286/37e1408925.jpg","shareintro":"仅售126.00元，Stripelife系列简约休闲长版薄外套  。衫点扮\u2014汇集全球时尚好毛衣。","sharetitle":"【要不要买这件毛衣，快来帮我看一看吧】","maxquantity":5}}
     */

    private int error_code;
    private String error_msg;
    private int total;
    /**
     * mallDetails : {"name":"简约休闲长版薄外套","pic":"/Upload/Product/214001664286/37e1408925.jpg","proid":"214001664286","price":"126.0000","costhtml":"","cprice":"126.0000","transprort_id":"5","vender_id":"","category_id":"","wara_id":"白银","spu_id":"均码","detail":"<html><body style='margin:0'><img src='http://sandban.com//Upload/Product/214001664286/37e140884b.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408842.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408857.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408812.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408845.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e14088b4.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408897.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408898.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408885.jpg' hidefocus='true' style='width:100%' /><\/body><\/html>","content":"<html><head><meta name='viewport' content='width = 320, maximum-scale=1.3, user-scalable=no'><style type='text/css'>table{width:100%;}td{height: 24px; font-size:14px; border-bottom:1px solid #f5f5f5;}div{color:#636161;font-size:18px;padding:20px 0px;}<\/style><\/head><body style='padding:10px;'><div>产品属性<\/div><table><tr><td>人群<\/td><td>女士<\/td><tr><tr><td>季节<\/td><td>春<\/td><tr><tr><td>风格<\/td><td>简约<\/td><tr><tr><td>流行元素<\/td><td>纯色<\/td><tr><tr><td>毛衫款型<\/td><td>开胸衫<\/td><tr><tr><td>版型<\/td><td>直筒型<\/td><tr><tr><td>袖型<\/td><td>长袖<\/td><tr><tr><td>领型<\/td><td>V领<\/td><tr><tr><td>衣门襟<\/td><td>其它<\/td><tr><tr><td>成份<\/td><td>棉<\/td><tr><tr><td>含毛量<\/td><td>-<\/td><tr><tr><td>针数<\/td><td>12针<\/td><tr><\/table><div>尺码表（单位：CM）<\/div><table><thead><tr><td>尺码<\/td><td>衣长<\/td><td>肩宽<\/td><td>胸围<\/td><td>袖长<\/td><\/tr><\/thead><tbody><tr><td>均码<\/td><td>84<\/td><td>39<\/td><td>50<\/td><td>55<\/td><\/tr><\/tbody><\/table><\/body><\/html>","sharelink":"http://sandban.com/Mall/235000040127","sharepic":"/Upload/Product/214001664286/37e1408925.jpg","shareintro":"仅售126.00元，Stripelife系列简约休闲长版薄外套  。衫点扮\u2014汇集全球时尚好毛衣。","sharetitle":"【要不要买这件毛衣，快来帮我看一看吧】","maxquantity":5}
     */

    private DataBean data;

    public static YouHuoProducBean objectFromData(String str) {

        return new Gson().fromJson(str, YouHuoProducBean.class);
    }

    public static YouHuoProducBean objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), YouHuoProducBean.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<YouHuoProducBean> arrayYouHuoProducBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<YouHuoProducBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<YouHuoProducBean> arrayYouHuoProducBeanFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<YouHuoProducBean>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public int getError_code() {
        return error_code;
    }

    public void setError_code(int error_code) {
        this.error_code = error_code;
    }

    public String getError_msg() {
        return error_msg;
    }

    public void setError_msg(String error_msg) {
        this.error_msg = error_msg;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * name : 简约休闲长版薄外套
         * pic : /Upload/Product/214001664286/37e1408925.jpg
         * proid : 214001664286
         * price : 126.0000
         * costhtml :
         * cprice : 126.0000
         * transprort_id : 5
         * vender_id :
         * category_id :
         * wara_id : 白银
         * spu_id : 均码
         * detail : <html><body style='margin:0'><img src='http://sandban.com//Upload/Product/214001664286/37e140884b.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408842.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408857.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408812.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408845.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e14088b4.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408897.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408898.jpg' hidefocus='true' style='width:100%' /><img src='http://sandban.com//Upload/Product/214001664286/37e1408885.jpg' hidefocus='true' style='width:100%' /></body></html>
         * content : <html><head><meta name='viewport' content='width = 320, maximum-scale=1.3, user-scalable=no'><style type='text/css'>table{width:100%;}td{height: 24px; font-size:14px; border-bottom:1px solid #f5f5f5;}div{color:#636161;font-size:18px;padding:20px 0px;}</style></head><body style='padding:10px;'><div>产品属性</div><table><tr><td>人群</td><td>女士</td><tr><tr><td>季节</td><td>春</td><tr><tr><td>风格</td><td>简约</td><tr><tr><td>流行元素</td><td>纯色</td><tr><tr><td>毛衫款型</td><td>开胸衫</td><tr><tr><td>版型</td><td>直筒型</td><tr><tr><td>袖型</td><td>长袖</td><tr><tr><td>领型</td><td>V领</td><tr><tr><td>衣门襟</td><td>其它</td><tr><tr><td>成份</td><td>棉</td><tr><tr><td>含毛量</td><td>-</td><tr><tr><td>针数</td><td>12针</td><tr></table><div>尺码表（单位：CM）</div><table><thead><tr><td>尺码</td><td>衣长</td><td>肩宽</td><td>胸围</td><td>袖长</td></tr></thead><tbody><tr><td>均码</td><td>84</td><td>39</td><td>50</td><td>55</td></tr></tbody></table></body></html>
         * sharelink : http://sandban.com/Mall/235000040127
         * sharepic : /Upload/Product/214001664286/37e1408925.jpg
         * shareintro : 仅售126.00元，Stripelife系列简约休闲长版薄外套  。衫点扮—汇集全球时尚好毛衣。
         * sharetitle : 【要不要买这件毛衣，快来帮我看一看吧】
         * maxquantity : 5
         */

        private MallDetailsBean mallDetails;

        public static DataBean objectFromData(String str) {

            return new Gson().fromJson(str, DataBean.class);
        }

        public static DataBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), DataBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<DataBean> arrayDataBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<DataBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<DataBean> arrayDataBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<DataBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public MallDetailsBean getMallDetails() {
            return mallDetails;
        }

        public void setMallDetails(MallDetailsBean mallDetails) {
            this.mallDetails = mallDetails;
        }

        public static class MallDetailsBean {
            private String name;
            private String pic;
            private String proid;
            private String price;
            private String costhtml;
            private String cprice;
            private String transprort_id;
            private String vender_id;
            private String category_id;
            private String wara_id;
            private String spu_id;
            private String detail;
            private String content;
            private String sharelink;
            private String sharepic;
            private String shareintro;
            private String sharetitle;
            private int maxquantity;

            public static MallDetailsBean objectFromData(String str) {

                return new Gson().fromJson(str, MallDetailsBean.class);
            }

            public static MallDetailsBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), MallDetailsBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<MallDetailsBean> arrayMallDetailsBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<MallDetailsBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<MallDetailsBean> arrayMallDetailsBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    Type listType = new TypeToken<ArrayList<MallDetailsBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getPic() {
                return pic;
            }

            public void setPic(String pic) {
                this.pic = pic;
            }

            public String getProid() {
                return proid;
            }

            public void setProid(String proid) {
                this.proid = proid;
            }

            public String getPrice() {
                return price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public String getCosthtml() {
                return costhtml;
            }

            public void setCosthtml(String costhtml) {
                this.costhtml = costhtml;
            }

            public String getCprice() {
                return cprice;
            }

            public void setCprice(String cprice) {
                this.cprice = cprice;
            }

            public String getTransprort_id() {
                return transprort_id;
            }

            public void setTransprort_id(String transprort_id) {
                this.transprort_id = transprort_id;
            }

            public String getVender_id() {
                return vender_id;
            }

            public void setVender_id(String vender_id) {
                this.vender_id = vender_id;
            }

            public String getCategory_id() {
                return category_id;
            }

            public void setCategory_id(String category_id) {
                this.category_id = category_id;
            }

            public String getWara_id() {
                return wara_id;
            }

            public void setWara_id(String wara_id) {
                this.wara_id = wara_id;
            }

            public String getSpu_id() {
                return spu_id;
            }

            public void setSpu_id(String spu_id) {
                this.spu_id = spu_id;
            }

            public String getDetail() {
                return detail;
            }

            public void setDetail(String detail) {
                this.detail = detail;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public String getSharelink() {
                return sharelink;
            }

            public void setSharelink(String sharelink) {
                this.sharelink = sharelink;
            }

            public String getSharepic() {
                return sharepic;
            }

            public void setSharepic(String sharepic) {
                this.sharepic = sharepic;
            }

            public String getShareintro() {
                return shareintro;
            }

            public void setShareintro(String shareintro) {
                this.shareintro = shareintro;
            }

            public String getSharetitle() {
                return sharetitle;
            }

            public void setSharetitle(String sharetitle) {
                this.sharetitle = sharetitle;
            }

            public int getMaxquantity() {
                return maxquantity;
            }

            public void setMaxquantity(int maxquantity) {
                this.maxquantity = maxquantity;
            }
        }
    }
}
